<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateOrderPayCouponsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('order_pay_coupons', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('order_pay_id')->nullable()->comment('支付订单id');
			$table->integer('coupon_id')->nullable()->comment('优惠券id');
			$table->text('coupon_object', 65535)->nullable()->comment('优惠券快照 防止后台更改数据');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('order_pay_coupons');
	}

}
